<?php if (count($models)):?>
<ul class="page-list">
    <?php foreach ($models as $model):?>
    <li>
        <?php if ($isRequired):?>
            <?php echo CHtml::checkBox('pages[]', in_array($model->id, $instances), array('value'=>$model->id, 'id'=>'page_'.$model->id)) ?>
            <?php echo CHtml::label($model->title, 'page_'.$model->id);?>
        <?php else:?>
            <?php 
            if (isset($_GET['layout'])) unset($_GET['layout']);
            echo CHtml::link($model->title, array('/Cms/admin/page/update', 'id'=>$model->id), array('target'=>'_parent'));?>
        <?php endif;?>
    </li>
    <?php endforeach;?>
</ul>
<?php else:?>
<p>Not have any instance</p>
<?php endif;?>